package cn.com.api.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import cn.com.api.entity.ApiT_goods_activity;
import cn.com.api.resultpage.CarOrderPage;
import cn.com.util.*;

//DAO
public interface ApiT_goods_activityMapper {

	// 根据id查看
	public ApiT_goods_activity findT_goods_activityById(@Param("id") Integer id);

	// 查看数据集
	public List<ApiT_goods_activity> findT_goods_activitys();

	public List<ApiT_goods_activity> groupByAll(@Param("cityid") String cityid,
			@Param("actid") String actid);

	public List<ApiT_goods_activity> searGruopAll(@Param("actid") String actid);

	public List<Map<String, Object>> searActTime(Map<String, String> map);

	public boolean updateOver(@Param("isover") String isover,
			@Param("actid") String actid);

	// 查看营销活动商品
	public List<ApiT_goods_activity> findT_goods_activitysByActTypeIdListPage(
			@Param("cityid") Integer cityid,
			@Param("act_type_id") Integer act_type_id,
			@Param("stime") String stime, @Param("etime") String etime,
			@Param("page") PageInfo pi);

	//查看活动商品----积分商城不需要开始结束时间
	public List<ApiT_goods_activity> findT_goods_activitysByActTypeIdAndCityIdListPage(
			@Param("cityid") Integer cityid,
			@Param("act_type_id") Integer act_type_id,
			@Param("page") PageInfo pi);
	
	// 查看营销活动商品
	public List<ApiT_goods_activity> findEndTime(
			@Param("cityid") Integer cityid,
			@Param("act_type_id") Integer act_type_id,
			@Param("page") PageInfo pi);

	// 查看营销活动商品
	public List<ApiT_goods_activity> findT_goods_activitysByActTypeId(
			@Param("act_type_id") Integer act_type_id);

	/** 根据actidList 查询productList */
	public List<CarOrderPage> searchProductsByActIds(List<Integer> list);

	// 添加
	public int insertT_goods_activity(ApiT_goods_activity t_goods_activity);

	public List<Map<String, Object>> searOverAct();

	// 修改
	public int updateT_goods_activity(ApiT_goods_activity t_goods_activity);

	// 删除
	public int deleteT_goods_activity(@Param("id") Integer id);

	public Map<String, Object> searJin(@Param("actid") String actid,
			@Param("cid") String cid);
	
	public Map<String, Object> searOverJin(@Param("actid") String actid,
			@Param("cid") String cid);

	public Integer checkActTime(@Param("actid") String actid,
			@Param("cityid") String cityid, @Param("time") String time,
			@Param("oldetime") String oldetime,
			@Param("oldstime") String oldstime,@Param("time1") String time1,@Param("charge_money")String charge_money);
	
	//根据条件查询活动商品
	public List<ApiT_goods_activity> searchActivityGoodsListPage(@Param("map")Map<String,Object> conditions,@Param("page")PageInfo page);
	
	//根据条件查询营销活动类型的商品信息集
	public List<Map<String, Object>> searchActivityGoodsInfoListPage(@Param("map")Map<String,Object> conditions,@Param("page")PageInfo page);
	
	
	
	//根据city_id 当前时间 查询充值有礼的商品列表
	public List<ApiT_goods_activity> searchChargeActivityGoodsByCityId(@Param("act_type_id")String act_type_id,@Param("city_id")String city_id);
}
